<template>
    <div class="rank">
        <div class="top-title">
            <div class="circle-bg"></div>
            <div class="rank-title">
                <div class="title-item " :class="{active:currentIndex == 1}" @click="chooseType(1)">
                    <span>本地排行</span>
                </div>
                <div class="title-item" :class="{active:currentIndex == 2}" @click="chooseType(2)">
                    <span>全国排行</span>
                </div>
            </div>
        </div>
        <div class="rank-content">
            <div class="rank-item clearfix">
                <div class="fl rank-num">1</div>
                <div class="fl user-avatar">
                    <img src="../assets/avator.jpg" alt="">
                </div>
                <div class="fl user-name">
                    <p class="name">莫失莫忘</p>
                    <p class="level-name">顽强青铜Lv.1</p>
                </div>
            </div>
            <div class="rank-item clearfix">
                <div class="fl rank-num">2</div>
                <div class="fl user-avatar">
                    <img src="../assets/avator.jpg" alt="">
                </div>
                <div class="fl user-name">
                    <p class="name">莫失莫忘</p>
                    <p class="level-name">顽强青铜Lv.1</p>
                </div>
            </div>
            <div class="rank-item clearfix">
                <div class="fl rank-num">3</div>
                <div class="fl user-avatar">
                    <img src="../assets/avator.jpg" alt="">
                </div>
                <div class="fl user-name">
                    <p class="name">莫失莫忘</p>
                    <p class="level-name">顽强青铜Lv.1</p>
                </div>
            </div>
        </div>

    </div>
</template>

<script>
    export default {
        name: "rank",
        data(){
            return {
                currentIndex:1
            }
        },
        methods:{
            chooseType(type){
                this.currentIndex = type;
            }
        }
    }
</script>

<style scoped lang="less">
    .rank{
        width: 100vw;
        height: 100vh;
        overflow-y: scroll;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        min-height: calc(100% + 1px);
        background-color: #1472cc;
    }
    .top-title{
        height:3rem;
        position: relative;
        overflow: hidden;
        .circle-bg{
            position: absolute;
            background-color: #294a99;
            width: 7.5rem;
            height: 6rem;
            top: -3rem;
            border-radius: 100%;
        }
        .rank-title{
            margin-top: 0.8rem;
            position: relative;
            padding: 0.3rem 1rem;
            z-index: 9;
            display: flex;
            .title-item{
                flex: 1;
                text-align: center;
                font-size: 0.4rem;
                color: #b8b2f5;
                line-height: 1.2;
                &:nth-child(1){
                    border-right: 2px solid #b7c1ff;
                }
                &.active{
                    span{
                        color: #FFFFFF;
                        display: inline-block;
                        border-bottom: 2px solid #FFFFFF;
                        padding-bottom: 0.1rem;
                    }

                }
            }
        }
    }
    .rank-content{
        padding: 0.1rem 0.35rem;
        margin-top: -1rem;
        position: relative;
        z-index: 9;
        .rank-item{
            margin-bottom: 0.1rem;
            height: 1.6rem;
            border: 1px solid #a2ebff;
            background-color: #007bc1;
            border-radius:0.1rem;
            padding: 0.2rem 0.3rem;
            box-shadow: 0 2px 1px rgba(24, 24, 24, 0.6);
            .rank-num{
                margin-top: 0.3rem;
                width: 0.6rem;
                height: 0.6rem;
                background-color: #294a99;
                color: #FFFFFF;
                font-size: 0.3rem;
                line-height: 0.6rem;
                text-align: center;
                border-radius:50%;
            }
            .user-avatar{
                margin-left: 0.3rem;
                width: 1.2rem;
                height: 1.2rem;
                border-radius:50%;
                overflow: hidden;
                border: 0.06rem solid #FFFFFF;
            }
            .user-name{
                margin-left: 0.3rem;
                color: #FFFFFF;
                font-size: 0.3rem;
                padding-top: 0.1rem;
                p{
                    text-shadow: 0 3px 2px #404040;
                }
                .name{

                }
                .level-name{
                    margin-top: 0.1rem;
                    color: #efffc5;
                }
            }
        }
    }
</style>
